package com.sdp.irrigation.excel.field;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sdp.core.bizc.vo.BusinessContext;
import com.sdp.irrigation.db.irrigation_field.service.IIrrigationFieldService;
import com.sdp.right.excel.importExcel.ImportExcelCallbackService;


@Service
public class AfterCallback implements ImportExcelCallbackService{
	
	@Autowired
	private IIrrigationFieldService iIrrigationFieldService;

	@Override
	public BusinessContext execute(HttpServletRequest request, HttpServletResponse response) {
		BusinessContext businessContext = new BusinessContext();
		try {
			iIrrigationFieldService.updateTime();
		} catch (Exception e) {
			businessContext.setSuccess(false);
		}
		return businessContext;
	}

}
